package com.lecture.springlecture.event.spring;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

//事件监听器
@Component
public class MailTaskFinishListener2 implements ApplicationListener<TaskFinishEvent2> {

    private String email = "harvey@163.com";

    @Override
    public void onApplicationEvent(TaskFinishEvent2 event) {

        System.out.println("Send Email to " + email + " Task:" + event.getSource());

    }
}